<input type="hidden" id="change_profile_status" value="<?php echo $this->session->flashdata('change_profile_status'); ?>" />
<script type="text/javascript">
  $(document).ready(function() {
    $("#user_join_date").datepicker({
      format: 'dd-mm-yyyy'
    });
    $("#user_birthday_date").datepicker({
      format: 'dd-mm-yyyy'
    });
    var change_profile_status = $.trim($('#change_profile_status').val());
    if (change_profile_status == 1) {
      toastr.success('Successfully updated your profile !');
      return false;
    }
    if (change_profile_status == 2) {
      toastr.error('No changes made !');
      return false;
    }
  });
</script>

<div class="page" style="min-height: 500px;">
  <div class="page-container">
    <div class="container">
      <div class="row">
        <div class="span3">
          <h4>Settings</h4>
          <div class="sidebar">
            <ul class="col-nav span3">
              <li style="background-color: #EEE; outline: solid #CCC 1px;"><a href="<?php echo base_url('settings/profile'); ?>"><i class="pull-right"></i>Profile</a></li>
              <li><a href="<?php echo base_url('settings/photo'); ?>"><i class="pull-right"></i>Photo</a></li>
              <li><a href="<?php echo base_url('settings/password'); ?>"><i class="pull-right"></i>Password</a></li>
              <li><a href="<?php echo base_url('settings/others'); ?>"><i class="pull-right"></i>Others</a></li>
            </ul>
          </div>
        </div>
        <div class="span9">
          <h4 class="header">Change profile</h4>
          <form class="form-horizontal" method="post" action="<?php echo base_url('settings/profile'); ?>">
            <input type="hidden" name="csrf_token" value="<?php echo set_csrf_token(); ?>"/>
            <h6>Career</h6>
            <div class="control-group">
              <label class="control-label">Position <span style="color: tomato;">*</span></label>
              <div class="controls">
                <select name="user_position" id="user_position" >
                  <option>--</option>
                  <?php foreach ($positions_array as $position) { ?>
                    <option <?php if ($user_data['user_position'] == $position) { ?> selected <?php } ?> value="<?php echo $position; ?>"><?php echo $position; ?></option>
                  <?php } ?>
                </select>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Experience <span style="color: tomato;">*</span></label>
              <div class="controls">
                <select name="user_experience" id="user_experience" >
                  <option>--</option>
                  <?php foreach ($exp_array as $exp) { ?>
                    <option <?php if ($user_data['user_experience'] == $exp) { ?> selected <?php } ?> value="<?php echo $exp; ?>"><?php echo $exp; ?></option>
                  <?php } ?>
                </select>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Skills / Tools <span style="color: tomato;">*</span></label>
              <div class="controls">
                <input name="user_skills" id="user_skills" type="text" placeholder="Java, PHP, etc..." value="<?php echo $user_data['user_skills']; ?>"/>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Joined <span style="color: tomato;">*</span></label>
              <div class="controls">
                <?php if ((strtotime($user_data['user_join_date'])) && ($user_data['user_join_date'] != '0000-00-00 00:00:00')) { ?>
                  <input name="user_join_date" id="user_join_date" type="text" placeholder="Joined innovature on ?" value="<?php echo @date('d-m-Y', strtotime($user_data['user_join_date'])); ?>"/>&nbsp;<i class="icon-calendar"></i>
                <?php } else { ?>
                  <input name="user_join_date" id="user_join_date" type="text" placeholder="Joined innovature on ?" value=""/>&nbsp;<i class="icon-calendar"></i>
                <?php } ?>
              </div>
            </div>
            <h6>Personal</h6>
            <div class="control-group">
              <label class="control-label">Display name <span style="color: tomato;">*</span></label>
              <div class="controls">
                <input name="user_display_name" id="display_name" type="text" placeholder="Display name (30)" value="<?php echo $user_data['user_display_name']; ?>" maxlength="30"/>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Gender</label>
              <div class="controls">
                <select name="user_gender" id="user_gender" >
                  <option <?php if ($user_data['user_gender'] == 'Male') { ?> selected <?php } ?> value="Male">Male</option>
                  <option <?php if ($user_data['user_gender'] == 'Female') { ?> selected <?php } ?> value="Female">Female</option>
                </select>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Hobbies / Interests</label>
              <div class="controls">
                <input name="user_hobbies" id="user_hobbies" type="text" placeholder="Reading, Music, etc..." value="<?php echo $user_data['user_hobbies']; ?>"/>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Birthday <span style="color: tomato;">*</span></label>
              <div class="controls">
                <?php if ((strtotime($user_data['user_birthday_date'])) && ($user_data['user_birthday_date'] != '0000-00-00 00:00:00')) { ?>
                  <input name="user_birthday_date" id="user_birthday_date" type="text" placeholder="Birthday on ?" value="<?php echo @date('d-m-Y', strtotime($user_data['user_birthday_date'])); ?>"/>&nbsp;<i class="icon-calendar"></i>
                <?php } else { ?>
                  <input name="user_birthday_date" id="user_birthday_date" type="text" placeholder="Birthday on ?" value=""/>&nbsp;<i class="icon-calendar"></i>
                <?php } ?>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Place <span style="color: tomato;">*</span></label>
              <div class="controls">
                <input name="user_place" id="user_place" type="text" placeholder="Ankamaly, Ernkaulam, Kerala" value="<?php echo $user_data['user_place']; ?>"/>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">About me</label>
              <div class="controls">
                <textarea name="user_about_me" id="user_about_me" maxlength="250" placeholder="Tell about yourself ! (250)"><?php echo $user_data['user_about_me']; ?></textarea>
              </div>
            </div>
            <h6>Contact</h6>
            <div class="control-group">
              <label class="control-label">Home email </label>
              <div class="controls">
                <input name="user_home_email" id="user_home_email" type="text" placeholder="user@example.com" value="<?php echo $user_data['user_home_email']; ?>"/>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Work email </label>
              <div class="controls">
                <input readonly="readonly" name="user_work_email" id="user_work_email" type="text" placeholder="user@innovaturelabs.com" value="<?php echo $user_data['user_work_email']; ?>"/>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Contact number </label>
              <div class="controls">
                <input name="user_contact_no" id="user_contact_no" type="text" placeholder="+919876543210" value="<?php echo $user_data['user_contact_no']; ?>"/>
              </div>
            </div>
            <div class="control-group"> 
              <div class="controls">
                <button type="submit" class="btn">Save Changes</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>